package com.hsylient.javase.chapter12.demo02;

import lombok.SneakyThrows;

import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    @SneakyThrows
    public static void main(String[] args) {
        ServerSocket serverSocket = new ServerSocket(9000);
        Socket accept = serverSocket.accept();
        OutputStream outputStream = accept.getOutputStream();
        outputStream.write("hsylient".getBytes());
        outputStream.close();
        serverSocket.close();
    }
}
